home *** CD-ROM | disk | FTP | other *** search
/ Super PC 31 / Super PC 31 (Shareware).iso / spc / inter / speakf / fuente / idea / bench.c next >
Encoding:
C/C++ Source or Header  |  1995-08-07  |  952 b   |  32 lines

  1. #define BENCHMARK    200
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <windows.h>
  7.  
  8. #include "idea.h"
  9.  
  10. void main()
  11. {
  12.     DWORD start, t;
  13.     double e;
  14.     int i;
  15.     unsigned short iv[8];
  16.     unsigned char key[] = "Cobble up some key for this benchmark.";
  17.     static unsigned char buffer[8000]; 
  18.  
  19.     printf("Running benchmark: please be patient.\n");
  20.     initcfb_idea(iv, key, FALSE);    
  21.     start = GetTickCount();
  22.     for (i = 0; i < BENCHMARK; i++) {
  23.         ideacfb(buffer, sizeof buffer);
  24.     }
  25.     t = GetTickCount() - start; 
  26.     e = (((double) BENCHMARK * (sizeof buffer) * 1000.0) / t);
  27. //    printf("%ld bytes in %ld milliseconds:\n", (long) BENCHMARK * (sizeof buffer), t);                 
  28.     printf("%.0f bytes per second.\n", e);                
  29.     printf("\nPlease E-mail the line:\n\n    %.0f\n\nalong with a description of your machine\n", e);
  30.     printf("(for example 486/50) to kelvin@fourmilab.ch.\n\nThank you!\n");
  31. }
  32.